package cn.fuck;

import java.util.stream.Stream;

public class SectionSOF {
    public static void main(String[] args) {
        //来自https://stackoverflow.com/questions/32414088/java-8-stream-difference-between-limit-and-skip?r=SearchResults&s=6|68.0260
        Stream.of(1,2,3,4,5,6,7,8,9)  // source
                .peek(x->System.out.print("\nA"+x))
                .limit(3)
                .peek(x->System.out.print("B"+x))
                .forEach(x->System.out.print("C"+x));// terminal operation
        Stream.of(1,2,3,4,5,6,7,8,9)
                .peek(x->System.out.print("\nA"+x))
                .skip(6)
                .peek(x->System.out.print("B"+x))
                .forEach(x->System.out.print("C"+x));

    }
}
